package com.diaohw.module.system.obj.mapstruct;

import com.diaohw.module.system.obj.dto.PermissionDto;
import com.diaohw.module.system.obj.entity.Permission;
import com.diaohw.module.system.obj.vo.PermissionVo;
import com.diaohw.platform.remote.auth.obj.bo.PermissionBO;
import org.mapstruct.IterableMapping;
import org.mapstruct.Mapper;
import org.mapstruct.factory.Mappers;

import java.util.List;

/**
 * <p>
 * 系统权限 类型转换
 * </p>
 *
 * @author D-Hw
 * @since 2024-07-05
 */
@Mapper
public interface PermissionMapstruct {

    PermissionMapstruct INSTANCE = Mappers.getMapper(PermissionMapstruct.class);

    /**
     * dto to entity
     */
    Permission dtoToEntity(PermissionDto dto);

    /**
     * entity to dto
     */
    PermissionDto entityToDto(Permission entity);

    /**
     * entity to Vo
     */
    PermissionVo entityToVo(Permission entity);
    PermissionBO entityToBo(Permission entity);

    @IterableMapping(elementTargetType = PermissionVo.class)
    List<PermissionVo> entityToVo(List<Permission> entity);

}

